import request from "@/utils/request"

// 获取所有课程评论列表
export const queryAllCourseComment = (username, page, pageSize) => {
    return request.get('/courseComment', {
        params: {
            username: username,
            page: page,
            pageSize: pageSize
        }
    }).then((result) => result.data)
}

// 根据id查询课程评论
export const queryCourseCommentById = (id) => {
    return request.get('/courseComment', {
        params: {
            id: id
        }
    }).then((result) => result.data)
}

//删除课程评论信息
export const deleteCourseComment = (ids) => {
    return request.delete('/courseComment', {
        params: {
            ids: ids
        }
    }).then((result) => result.data) 
}

//添加课程评论信息
export const addCourseComment = (data) => {
    return request.post('/courseComment', data)
        .then((result) => result.data)
}

//修改课程评论信息
export const updateCourseComment = (data) => {
    return request.put('/courseComment', data)
       .then((result) => result.data) 
}